{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# TERMINAL with .STRINGZ" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Assembled! Use %dis or %dump to examine; use %exe to run.\n" ] } ], "source": [ ".ORIG x3000\n", ".SET MODE TERMINAL\n", " LEA R0, DATA\n", " TERMINAL R0\n", " HALT\n", "DATA: .STRINGZ \"Hello, world!\\n\"\n", ".END" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "============================================================\n", "Memory dump:\n", "============================================================\n", " x3000: xE002\n", " x3001: xD000\n", " x3002: xF025\n", " x3003: x0048\n", " x3004: x0065\n", " x3005: x006C\n", " x3006: x006C\n", " x3007: x006F\n", " x3008: x002C\n", " x3009: x0020\n", " x300A: x0077\n", " x300B: x006F\n", " x300C: x0072\n", " x300D: x006C\n", " x300E: x0064\n", " x300F: x0021\n", " x3010: x000A\n", " x3011: x0000\n" ] } ], "source": [ "%dump x3000 x3011" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
Hello, world!\n",
       "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "============================================================\n", "Computation completed\n", "============================================================\n", "Instructions: 3\n", "Cycles: 26 (0.000013 milliseconds)\n", "\n", "============================================================\n", "Registers:\n", "============================================================\n", "PC: x048E\n", "N: 0 Z: 0 P: 1 \n", "R0: x3003 R1: x0000 R2: x0000 R3: x0000 \n", "R4: x0000 R5: x0000 R6: x0000 R7: x3003 \n" ] } ], "source": [ "%exe" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# TERMINAL with .STRINGC" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Assembled! Use %dis or %dump to examine; use %exe to run.\n" ] } ], "source": [ ".ORIG x3000\n", ".SET MODE TERMINAL\n", " LEA R0, DATA\n", " TERMINAL R0\n", " HALT\n", "DATA: .STRINGC \"Hello, world!\\n\"\n", ".END" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "============================================================\n", "Memory dump:\n", "============================================================\n", " x3000: xE002\n", " x3001: xD000\n", " x3002: xF025\n", " x3003: x6548\n", " x3004: x6C6C\n", " x3005: x2C6F\n", " x3006: x7720\n", " x3007: x726F\n", " x3008: x646C\n", " x3009: x0A21\n", " x300A: x0000\n" ] } ], "source": [ "%dump x3000 x300A" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
Hello, world!\n",
       "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "============================================================\n", "Computation completed\n", "============================================================\n", "Instructions: 3\n", "Cycles: 26 (0.000013 milliseconds)\n", "\n", "============================================================\n", "Registers:\n", "============================================================\n", "PC: x048E\n", "N: 0 Z: 0 P: 1 \n", "R0: x3003 R1: x0000 R2: x0000 R3: x0000 \n", "R4: x0000 R5: x0000 R6: x0000 R7: x3003 \n" ] } ], "source": [ "%exe" ] } ], "metadata": { "kernelspec": { "display_name": "Calysto LC3", "language": "gas", "name": "calysto_lc3" }, "language_info": { "codemirror_mode": { "name": "gas", "version": 3 }, "file_extension": ".asm", "mimetype": "text/x-gas", "name": "gas" } }, "nbformat": 4, "nbformat_minor": 0 }